﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;

namespace TODO.Models
{
	public class Task
	{
		[Key]
		public int TaskId
		{
			get;
			set;
		}

		public string Name
		{
			get;
			set;
		}

		public string Description
		{
			get;
			set;
		}

		public int? StatusId
		{
			get;
			set;
		}

		[ForeignKey( "StatusId" )]
		public virtual Status Status
		{
			get;
			set;
		}

		public virtual ICollection<Note> Notes
		{
			get;
			set;
		}
		
		public DateTime? CreatedOn
		{
			get;
			set;
		}
		public DateTime? ModifiedOn
		{
			get;
			set;
		}
	}

	public class Status
	{
		[Key]
		public int StatusId
		{
			get;
			set;
		}
		public string Name
		{
			get;
			set;
		}
	}

	public class Note
	{
		[Key]
		public int NoteId
		{
			get;
			set;
		}
		public string Description
		{
			get;
			set;
		}
		public int? TaskId
		{
			get;
			set;
		}
		public DateTime? CreatedOn
		{
			get;
			set;
		}
		public DateTime? ModifiedOn
		{
			get;
			set;
		}
	}
}


